﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using sdamarketing.App_Code;

namespace sdamarketing
{
    public partial class News : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Int32.Parse(Session["idRole"].ToString()) != 1)
            {
                vestText.Visible = false;
                vestButton.Visible = false;
            }           
            

        }

       
        protected void vestButton_Click(object sender, EventArgs e)
        {
            news nw = new news();
            String date = DateTime.Today.Date.ToString();
            String time = DateTime.Today.Hour.ToString() + DateTime.Today.Minute.ToString() + DateTime.Today.Second.ToString();
            String DT = date + time;
            nw.insertVest(Int32.Parse(Session["idUser"].ToString()), vestText.Text, DT);
            Response.Redirect("~/Account/News.aspx");
        }
    }
}
